import request from '@/utils/request'


const baseUrl =  process.env.VUE_APP_CONTENXT_PATH + "/user";
const authBaseUrl =   process.env.VUE_APP_CONTENXT_PATH + "/auth";
// export function login(data) {
//     return request({
//       url: '/blogs-admin/auth/login',
//       method: 'post',
//       data
//     })
//   }

export function login(data) {
    return request({
        url: authBaseUrl + '/login',
        method: 'post',
        data
    })
}



export function login2(data) {
    return request({
        url: baseUrl + '/login',
        method: 'post',
        data
    })
}

export function getInfo(token) {
    return request({
        url: baseUrl + '/userInfo',
        method: 'get',
        params: { token }
    })
}


// export function logout() {
//   return request({
//     url: '/vue-element-admin/user/logout',
//     method: 'post'
//   })
// }
export function logout() {
    return request({
        url: baseUrl +  '/logout',
        method: 'post'
    })
}